"""
负责从首页跳转到各个页面
"""
from pom.main_page import MainPage
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from common.basedriver import BaseDriver


class JumpPage(BaseDriver):

    def __init__(self):
        self.mainPage=MainPage()
    #登录页面

    def jumpLogin(self):
        self.mainPage.main_login().click()

    #跳转到注册页面

    def jumpRegister(self):
        self.mainPage.main_register().click()

    #跳转到国内火车页面

    def jumpInsideTrain(self):

        ActionChains(self.driver).move_to_element(self.mainPage.main_train()).pause(3).perform()
        self.mainPage.mian_train_inside().click()

    #跳转到国外火车页面

    def jumpOutsideTrain(self):
        ActionChains(self.driver).move_to_element(self.mainPage.main_train_outside()).pause(3).perform()
        self.mainPage.main_train_outside().click()

    #打开竖排的火车
    def verticalTrainButton(self):
        self.mainPage.mian_train_vertical().click()


